//https://leetcode.cn/problems/climbing-stairs/?envType=study-plan-v2&envId=top-100-liked
//每次你可以爬 1 或 2 个台阶。你有多少种不同的方法可以爬到楼顶呢？
#include <vector>
#include <stack>
#include <list>
#include <map>
#include <string>
#include <unordered_map>

using namespace std;

class Solution {
public:
    int climbStairs(int number) {
        // write code here
        int res = 0;
        if (number <=0) return res;
        int last_n=1;
        int last_n_n=0;
        for(int i = 1;i<=number;++i) {
            res = last_n + last_n_n;
            last_n_n = last_n;
            last_n = res;
        }
        return res;
    }
};